<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // 面向对象的三大特点：封装，继承，多态

        // 多态：多种形态

        // 继承：


        class Cat {
            constructor(){}

            say() {
                console.log('喵');
            }
        }

        class Dog {
            constructor(name , age){
                this.name = name ;
                this.age = age ;
            }

            say() {
                console.log('汪');
            }
        }

        // say   表现出来的多态


        class KeJi {
            constructor(name , age){
                this.name = name ;
                this.age = age ;

                this.tui = '短'
            }

            say() {
                console.log('汪');
            }
        }


        // KeJi 可以继承 Dog 

    </script>
    
</body>
</html>